package cn.com.dhcc.ddi.task.service;

import cn.com.dhcc.ddi.task.vo.TableLog;

import java.util.List;
import java.util.Map;
import java.util.Set;

public class ChangeVo {

	private Map<String, TableLog> tableLogs;
	private Set<String> executeTableNames;

	private boolean tableDataFlag = false;// insert 数据状态

	private Map<String, List<Integer>> tableDataNum;

	private Map<String,List<RowPro>> tableData;//insert数据

	private Map<String,String> startValue; //抽取开始增量值
	private Map<String,String> endValue;   //抽取结束增量值
	
	private String id;//解析文件的唯一标示
	
	private boolean over;//是否已经解析到文件末尾

	public Map<String, TableLog> getTableLogs() {
		return tableLogs;
	}

	public void setTableLogs(Map<String, TableLog> tableLogs) {
		this.tableLogs = tableLogs;
	}

	public Set<String> getExecuteTableNames() {
		return executeTableNames;
	}

	public void setExecuteTableNames(Set<String> executeTableNames) {
		this.executeTableNames = executeTableNames;
	}


	public boolean isTableDataFlag() {
		return tableDataFlag;
	}

	public void setTableDataFlag(boolean tableDataFlag) {
		this.tableDataFlag = tableDataFlag;
	}

	public Map<String, List<Integer>> getTableDataNum() {
		return tableDataNum;
	}

	public void setTableDataNum(Map<String, List<Integer>> tableDataNum) {
		this.tableDataNum = tableDataNum;
	}


	public Map<String, List<RowPro>> getTableData() {
		return tableData;
	}

	public void setTableData(Map<String, List<RowPro>> tableData) {
		this.tableData = tableData;
	}


	public Map<String, String> getStartValue() {
		return startValue;
	}

	public void setStartValue(Map<String, String> startValue) {
		this.startValue = startValue;
	}

	public Map<String, String> getEndValue() {
		return endValue;
	}

	public void setEndValue(Map<String, String> endValue) {
		this.endValue = endValue;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public boolean isOver() {
		return over;
	}

	public void setOver(boolean over) {
		this.over = over;
	}

	/**
	 * 字段对象，封装了字段的有关属性
	 * 
	 * @日期 2015-9-1 下午2:46:21
	 * @作者  高强
	 */
	public static class ColPro{
		private String name;//字段名称
		private String value;//字段值
		private String pk;//是否是主键
		private String type;//字段类型
		
		public String getType() {
			return type;
		}
		public void setType(String type) {
			this.type = type;
		}
		public ColPro(String name, String value,String type) {
			super();
			this.name = name;
			this.value = value;
			this.type=type;
		}
		public ColPro(String name, String value, String pk,String type) {
			super();
			this.name = name;
			this.value = value;
			this.pk = pk;
			this.type=type;
		}
		public ColPro() {
			super();
			// TODO Auto-generated constructor stub
		}
		public String getName() {
			return name;
		}
		public void setName(String name) {
			this.name = name;
		}
		public String getValue() {
			return value;
		}
		public void setValue(String value) {
			this.value = value;
		}
		public String getPk() {
			return pk;
		}
		public void setPk(String pk) {
			this.pk = pk;
		}
		@Override
		public String toString() {
			return "ColPro [name=" + name + ", value=" + value + ", pk=" + pk
					+ ", type=" + type + "]";
		}
		
		
	}
	
	
	/**
	 * 行对象，封装了字段对象集合
	 * 
	 * @日期 2015-9-1 下午2:46:42
	 * @作者  高强
	 */
	public static  class RowPro{
		private Map<String,ColPro> colMap;/*key值为字段名称，value值为字段对象ColPro*/

		public Map<String, ColPro> getColMap() {
			return colMap;
		}

		public void setColMap(Map<String, ColPro> colMap) {
			this.colMap = colMap;
		}


		public RowPro() {
			super();
			// TODO Auto-generated constructor stub
		}

		public RowPro(Map<String, ColPro> colMap) {
			super();
			this.colMap = colMap;
		}

		@Override
		public String toString() {
			return "RowPro [colMap=" + colMap + "]";
		}
		
		
	}
	/**
	 * 字段类型
	 * 
	 * @日期 2015-9-1 下午2:53:51
	 * @作者  高强
	 */
	public static enum ColType{
		CHAR("CHAR","CHAR"),
		DATE("DATE","DATE"),
		NUMBER("NUMBER","NUMBER"),
		TIMESTAMP("TIMESTAMP","TIMESTAMP"),
		VARCHAR2("VARCHAR2","VARCHAR2");
		private String type;
		private String desc;
		
		private ColType(String type, String desc) {
			this.type = type;
			this.desc = desc;
		}
		
		public String getType() {
			return type;
		}
		
		public String getDesc() {
			return desc;
		}
		
		public void setType(String type) {
			this.type = type;
		}
		
		public void setDesc(String desc) {
			this.desc = desc;
		}
		
		public String value() {
			return this.type;
		}
		
		@Override
		public String toString() {
			return type;
		}
	}
	
	
	/**
	 * 新增sql语句 转换成update sql语句信息
	 * 
	 * @日期 2015-10-15 上午9:05:15
	 * @作者  高强
	 */
	public static class ConvertInfo{
		private String insertSql;//新增sql语句  insert into table(col1,col2,col3)
		private String updateSql;//转换成update时的sql语句
		private List<Integer> index;//主键索引 表的主键索引  (col1,col2,col3)主键的索引值
		public String getInsertSql() {
			return insertSql;
		}
		public void setInsertSql(String insertSql) {
			this.insertSql = insertSql;
		}
		public String getUpdateSql() {
			return updateSql;
		}
		public void setUpdateSql(String updateSql) {
			this.updateSql = updateSql;
		}
		
		public List<Integer> getIndex() {
			return index;
		}
		public void setIndex(List<Integer> index) {
			this.index = index;
		}
		@Override
		public String toString() {
			return "ConvertInfo [insertSql=" + insertSql + ", updateSql="
					+ updateSql + ", index=" + index + "]";
		}
		
		
	 }
}
